﻿using System;
using System.Net;

namespace Catchbase.Service.API
{
    public class ExceptionHandler
    {
        public virtual void Handle(WebException webException)
        {
            var response = webException.Response as HttpWebResponse;
            if (response == null) return;
            if(response.StatusCode == HttpStatusCode.Unauthorized)
                throw new AccessException();
        }

        public virtual void Handle(Exception exception)
        {
            
        }
    }
}